From 6e111d0a8eb6a143a4e2b2367081d342a41dcccd Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sun, 27 Mar 2011 09:30:35 +0100 Subject: [PATCH] x86_32: Fix _raw_read_trylock() build on some gcc versions. Was broken by 23099:612171ff82ea. A bool_t is a single byte, and needs a 'q' register constraint. Avoid the whole issue by changing the variable to an int, and explicitly specify the operand suffix as 'l' for good measure. Signed-off-by: Keir Fraser --- xen/include/asm-x86/spinlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h index 5f9fabd345..a31f8b725b 100644 --- a/xen/include/asm-x86/spinlock.h +++ b/xen/include/asm-x86/spinlock.h @@ -40,14 +40,14 @@ typedef struct { static always_inline int _raw_read_trylock(raw_rwlock_t *rw) { - bool_t acquired; + int acquired; asm volatile ( " lock; decl %0 \n" " jns 2f \n" "1: .subsection 1 \n" "2: lock; incl %0 \n" - " dec %1 \n" + " decl %1 \n" " jmp 1b \n" " .subsection 0 \n" : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" ); -- 2.30.2